package com.qianfeng.smartmeeting.controller.user;

import java.util.Arrays;
import java.util.Map;

//import org.apache.shiro.authz.annotation.RequiresPermissions;
import com.qianfeng.smartmeeting.util.PageUtils;
import com.qianfeng.smartmeeting.util.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import com.qianfeng.smartmeeting.entity.TimeslotEntity;
import com.qianfeng.smartmeeting.service.TimeslotService;




/**
 * 
 *
 * @author baixiaofei
 * @email 2053989588@qq.com
 * @date 2025-07-02 15:06:43
 */
@RestController
@RequestMapping("smartmeeting/user/timeslot")
public class TimeslotController {
    @Autowired
    private TimeslotService timeslotService;

    /**
     * 列表
     */
    @RequestMapping("/list")
    //@RequiresPermissions("smartmeeting:timeslot:list")
    public R list(@RequestParam Map<String, Object> params){
        PageUtils page = timeslotService.queryPage(params);

        return R.ok().put("page", page);
    }


    /**
     * 信息
     */
    @RequestMapping("/info/{timeId}")
    //@RequiresPermissions("smartmeeting:timeslot:info")
    public R info(@PathVariable("timeId") Integer timeId){
		TimeslotEntity timeslot = timeslotService.getById(timeId);

        return R.ok().put("timeslot", timeslot);
    }

    /**
     * 保存
     */
    @RequestMapping("/save")
    //@RequiresPermissions("smartmeeting:timeslot:save")
    public R save(@RequestBody TimeslotEntity timeslot){
		timeslotService.save(timeslot);

        return R.ok();
    }

    /**
     * 修改
     */
    @RequestMapping("/update")
    //@RequiresPermissions("smartmeeting:timeslot:update")
    public R update(@RequestBody TimeslotEntity timeslot){
		timeslotService.updateById(timeslot);

        return R.ok();
    }

    /**
     * 删除
     */
    @RequestMapping("/delete")
    //@RequiresPermissions("smartmeeting:timeslot:delete")
    public R delete(@RequestBody Integer[] timeIds){
		timeslotService.removeByIds(Arrays.asList(timeIds));

        return R.ok();
    }

}
